package com.itheima.d1_reflect_method;

import org.junit.jupiter.api.Test;

import java.lang.reflect.Method;

public class demo1 {
    @Test
    public void getDeclaredMethods(){
        Class c = Dog.class;

        Method[] methods = c.getDeclaredMethods();
        for (Method method : methods) {
            System.out.println(method.getName()+"======>"+method.getReturnType());
        }
    }

    @Test
    public void getDeclaredMethod() throws NoSuchMethodException {
        Class c = Dog.class;

        Method method = c.getDeclaredMethod("eat",String.class);

            System.out.println(method.getName()+"======>"+method.getReturnType());

    }
}
